home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / amos / AMOSList0993.lzh / AMOSLIST / 000188_amos-request@svcs1.digex.net_Wed Sep 15 15:05:38 1993.msg < prev    next >
Internet Message Format  |  1993-10-03  |  4KB

  1. Received: from nextsun.INS.CWRU.Edu by access.digex.net with SMTP id AA10127
  2.   (5.65c/IDA-1.4.4 for <mcox@access.digex.com>); Wed, 15 Sep 1993 15:05:32 -0400
  3. Received: from svcs1.digex.net by nextsun.INS.CWRU.Edu with SMTP (5.65b+ida+/CWRU-1.5.2-freenet-gw)
  4.     id AA12207; Wed, 15 Sep 93 14:31:35 -0400 (from amos-request@svcs1.digex.net )
  5. Received: by svcs1.digex.net id AA20683
  6.   (5.65c/IDA-1.4.4 for amos-list-out); Wed, 15 Sep 1993 14:05:41 -0400
  7. Received: from access.digex.net by svcs1.digex.net with SMTP id AA20679
  8.   (5.65c/IDA-1.4.4 for <amos-list@svcs1.digex.net>); Wed, 15 Sep 1993 14:05:34 -0400
  9. Received: from kruuna.Helsinki.FI by access.digex.net with SMTP id AA25425
  10.   (5.65c/IDA-1.4.4 for <amos-list@access.digex.net>); Wed, 15 Sep 1993 13:48:38 -0400
  11. Received: by kruuna.helsinki.fi id AA05528
  12.   (5.65c8/IDA-1.4.4 for amos-list@access.digex.net); Wed, 15 Sep 1993 20:48:23 +0300
  13. From: Mikko Makela <mmmakela@cc.helsinki.fi>
  14. Message-Id: <199309151748.AA05528@kruuna.helsinki.fi>
  15. Subject: AMAL-routine
  16. To: amos-list@access.digex.net
  17. Date: Wed, 15 Sep 1993 20:48:22 +0300 (EET DST)
  18. Mime-Version: 1.0
  19. Content-Type: text/plain; charset=US-ASCII
  20. Content-Transfer-Encoding: 7bit
  21. Content-Length: 2185      
  22. Status: O
  23.  
  24. Quite many of you showed interest with this, so I'm sending
  25. this to the list (it's < 2k).
  26. I decided to make litle demonstration program out of it, just
  27. to make it easier to understand.
  28.  
  29. --------------------cut here-------------------
  30.  
  31. 'This is a small demo program to show, how to use AMAL's Move-command
  32. 'for (de)acceleration of objects.
  33.  
  34. 'Programmed by Mikko Mdkeld
  35.  
  36. BALL=4 : Rem amount of balls
  37. _TOPSPEED=200 : LOWEST_POSSIBLE_STEPCOUNT=4
  38. 'R2 must not > RB (topspeed) 
  39. 'RC will tell the lowest possible number of steps in movement. 
  40. Amreg(1)=_TOPSPEED : Amreg(2)=LOWEST_POSSIBLE_STEPCOUNT
  41.  
  42.    'if ball hits the wall, main program will set R4=1, so 
  43.    'that the Move command will be initiliazed.
  44. A$="AUtotest (If R4=1 Jump Wall "
  45.    'if ball must be stopped, R3 will be set to 1, and 
  46.    'to continue the movement R3->2  
  47. A$=A$+"If R3=1 Jump Hold ;If R3=2 Jump Go on "
  48.    'R2 will be decreased every time the autotest is run, and
  49.    'if it's <1, ball will be stopped. 
  50.    'R2 is also used to count in how many steps will the movement be done. 
  51. A$=A$+"If R2<1 Direct Owait else Let R2=R2-1 eXit "
  52. A$=A$+"Wall:Let R4=0 Direct Begin "
  53. A$=A$+"Hold:Direct Sleep; Go on:Let R3=0 Direct Begin)"
  54.    'Here is the Move command
  55. A$=A$+"Begin:If R2<1 Jump Owait; Move R0,R1,RC*RB/R2; Jump Begin "
  56. A$=A$+"Sleep:Wait ;Owait: If R2>0 J Begin Pause J Owait "
  57.  
  58. 'let's make an boject to move
  59. Circle 100,100,7 : Paint 100,100 : Get Bob 0,1,90,90 To 111,111 : Cls 1
  60.  
  61. 'init each ball
  62. For L=0 To BALL-1
  63.    Channel L To Bob L
  64.    Bob L,80+L*15,80+L*15,1
  65.    Amal L,A$
  66.    Amreg(L,4)=1
  67. Next L
  68. 'try different values for speed,range & angle
  69. RSPEED=5000
  70. RANGE=50
  71. ANGLE#=3.3
  72. For L=0 To BALL-1
  73.    Amreg(L,0)=RANGE*Cos(ANGLE#-L*0.1) : Rem x-movemnt
  74.    Amreg(L,1)=RANGE*Sin(ANGLE#-L*0.1) : Rem y-movement 
  75.    Amreg(L,2)=RSPEED/RANGE+1 : Rem speed
  76.    Amreg(L,3)=0 : Rem just to make sure
  77.    Amreg(L,4)=1 : Rem to init movementsequence 
  78. Next L
  79.  
  80. Synchro Off : Amal On 
  81. Repeat 
  82.    For L=0 To BALL-1
  83.       'test for left screenborder
  84.       If X Bob(L)<1
  85.          Amreg(L,0)=-Amreg(L,0)
  86.          Amreg(L,4)=1
  87.          Bob L,0,,
  88.       End If 
  89.    Next L
  90.    'try without wait! 
  91.    Wait 2
  92.    Synchro 
  93. Until Amreg(0,2)<1
  94. End 
  95.  
  96.